<?php 
?>
<div>
	<a href="/product/add" class="mr5 btn btn-primary">添加产品</a>
</div>
<div class="widget-box">
	<div class="widget-content">
		<?php if($list):?>
		<table class="table table-bordered table-striped table-hover">
			<thead>
				<tr>
					<th width="20%">产品ID</th>
					<th width="35%">
						产品名称
					</th>
					<th width="20%">
						产品价格
					</th>
					<th width="20%">操作</th>
				</tr>
			</thead>
			<tbody data-listidx="0" data-type="dragsort" data-ajax="ajax/sort.php" data-td="1">
				<?php foreach ($list as $item):?>
				<tr style="cursor: pointer;" data-sort="1" data-id="1">
					<td><?php echo $item['id']?></td>
					<td><?php echo $item['product_name']?></td>
					<td><?php echo $item['product_price']?></td>
					<td>
						<a class="mr5" href="/product/edit?id=<?php echo $item['id']?>">编辑</a> 
						<a data-id="<?php echo $item['id']?>" class="mr5" data-href="/product/delete" data-type="del" href="javascript:void(0)" data-prompt="您确定要删除这个产品吗？">删除</a>
					</td>
				</tr>
				<?php endforeach;?>
			</tbody>
		</table>
		<div class="pagination alternate">
			<?php echo $pagination;?>
		</div>
		<?php else:?>
		<div class="alert alert-info alert-nolist">
			<h4 class="alert-heading">暂无数据</h4>
		</div>
		<?php endif;?>
		
	</div>
</div>
<script src="/scripts/libs/require/require.js" type="text/javascript" data-main="/scripts/app/list/main"></script>